What is the advantage of not running as root? [closed]

Posted by Shmuel Brill on Server Fault See other posts from Server Fault or by Shmuel Brill
Published on 2012-04-04T03:17:41Z Indexed on 2012/04/04 5:31 UTC
Read the original article Hit count: 550

Filed under:
|

Possible Duplicate:
What's wrong with always being root?

All modern brands of Linux highly discourage (or disable) one from running as root instead of a normal user.

I do not understand why.

As a "normal" user, one could

  1. Download a rouge program from the internet.
  2. Run it (After all, one isn't root, what can it do).
  3. It installs itself in .bashrc or .xinitrc
  4. It writes a rouge "sudo" and "su" and adds . to the path
  5. Not noticing that . is in path, one runs sudo.
  6. The rouge program now has root password and can do anything it wants in the system.

Even if 3-6 doesn't happen, the program could still

  1. Be part of a botnet.
  2. Read all files in the home directory and send them back (mine for SS#, Credit Card numbers, bank account numbers, etc).
  3. Send spam.
  4. Run a backdoor server to allow an attacker a chance to connect to the machine to determine vulnerabilities.

It seems that the whole "permissions" thing (root/non-root) is just to prevent amateur crackers from getting into the system, so the question is:

Is there a point in avoiding running as root, and is there a way to protect oneself if one wants to run unsafe code?

© Server Fault or respective owner

Related posts about linux

Related posts about user-permissions